package org.example.everyday;

/**
 * <p>
 * Description:TODO 详细描述
 * <p>
 * <p>
 *
 * @author anlu
 * @date 2022/7/8 9:47
 */
public class Lc1217 {
    public static void main(String[] args) {

        Lc1217 lc1217 = new Lc1217();
        int[] position = {2,2,2,3,3};
        int res = lc1217.minCostToMoveChips(position);
        System.out.println(res);
    }

    public int minCostToMoveChips(int[] position) {
        int event = 0, odd = 0;
        for(int pos : position){
            if((pos & 1) != 0){
                odd++;
            }else{

                event++;
            }
        }
        return Math.min(odd,event);
    }
}
